package com.zy.ivideo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

@Entity
@EntityListeners(AuditingEntityListener.class)
@Data
@ApiModel(value = "弹幕实体类",description = "弹幕实体类")
@Table(name = "b_bulletscreen")
public class BulletScreenEntity {
    /**
     * 主键
     */
    @ApiModelProperty(value = "主键id",position = 16,example = "0")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 数据类型 0-simplevideo 1-multitypevideo
     */
    @ApiModelProperty(value = "数据类型 0-simplevideo 1-multitypevideo",position = 16,example = "0")
    @Column(nullable = false,length = 2,columnDefinition = "COMMENT '数据类型 0-simplevideo 1-multitypevideo'")
    private int datatype;

    @ApiModelProperty(value = "资源id 短视频对应-item_id字段 放映厅对应-albumid字段",position = 16,example = "6992028792893997581")
    @Column(name = "itemid",length = 100,columnDefinition = "COMMENT '资源id'")
    private String itemid;

    @ApiModelProperty(value = "弹幕内容",position = 16,example = "这段太精彩了！")
    @Column(name = "content",length = 200,columnDefinition = "COMMENT '弹幕内容'")
    private String content;

    @ApiModelProperty(value = "用户id",position = 16,example = "0")
    @Column(name = "userid",columnDefinition = "COMMENT '用户id'")
    private int userid;

    @ApiModelProperty(value = "创建时间",position = 16,example = "2024-01-01 00:00:00")
    @CreatedDate
    @Column(name = "createtime",columnDefinition = "COMMENT '创建时间'")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createtime;

    @ApiModelProperty(value = "视频时间",position = 16,example = "01:23:30")
    @CreatedDate
    @Column(name = "playtime",columnDefinition = "COMMENT '视频时间'")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date playtime;

    @ApiModelProperty(value = "弹幕字体颜色",position = 16,example = "#00ff00")
    @Column(name = "fontcolor",length = 200,columnDefinition = "COMMENT '弹幕字体颜色'")
    private String fontcolor;

    @ApiModelProperty(value = "弹幕字体大小",position = 16,example = "25")
    @Column(name = "fontsize",columnDefinition = "COMMENT '弹幕字体大小'")
    private int fontsize;
}
